Electronic devices having cameras, such as an imaging devices, are often equipped with an image sensor, at least one camera lens and a viewfinder. The lens may be moved towards or away from the image sensor to focus an object or scene onto the camera image sensor. Electronic devices having cameras often utilize autofocus mechanisms for determining movement of the lens relative to the camera image sensor. Some electronic devices having cameras use phase detection autofocus for determining movement of the lens relative to the image sensor.
The viewfinder of the imaging device may have one or more defined regions of interest. The imaging device may use information obtained from the regions of interest to determine a camera lens position relative to the camera image sensor. When the scene being photographed includes small objects in the foreground, the distance between a foreground object and the camera lens (or the camera image sensor) may be less than the distance between the background scene (i.e. requiring a lens in an infinity position) and the camera lens (or the camera image sensor). Accordingly, the imaging device may average the distances and determine lens movement based on the averaged distance. The resulting lens position may not be an optimal lens position for focusing either the foreground object or the background scene onto the camera image sensor.
Like reference numerals are used in the drawings to denote like elements and features.